package com.aglhz.nature.view;

import java.util.List;

import com.aglhz.base.BaseActivity;
import com.aglhz.nature.R;
import com.aglhz.nature.adapter.ShopList2Adapter;
import com.aglhz.nature.modle.item.ShopListData;
import com.aglhz.nature.presenter.SecondClassificationPresenter;
import com.aglhz.nature.presenter.ShopList2Presenter;
import com.aglhz.nature.view.iv.ShopList2View;



import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import android.widget.TextView;

public class ShopList2Activity extends BaseActivity implements ShopList2View{
	private String id;
	private ListView listview;
	private ShopList2Presenter presenter;
	private ShopList2Adapter adapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.second_classification);
		setActionBarTitle("商品列表");
		listview=(ListView) findViewById(R.id.second_classification_listview);
		Intent intent =getIntent();
		id = intent.getStringExtra("brandId");
		Log.e("id",id);
		presenter=new ShopList2Presenter(this);
		// basePresenter register
				presenter.register();
				presenter.loadData();
	}
	
	
	@Override
	public String getId() {

		return id;
	}


	@Override
	public void showList(List<ShopListData> data) {
	adapter = new ShopList2Adapter(data,ShopList2Activity.this);
	listview.setAdapter(adapter);
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		// basePresenter unregister
		presenter.unregister();
	}
	
	
}
